﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

/// <summary>
/// Summary description for SiteGlobals
/// </summary>
public class SiteGlobals
{
    private SiteGlobals() { }
    public static string BaseUrl
    {
        get
        {
            //string baseUrl = System.Configuration.ConfigurationManager.AppSettings["BaseUrl"];
            //if (!string.IsNullOrEmpty(baseUrl))
            //{
            //    return baseUrl;
            //}

            string orginalUrl = HttpContext.Current.Request.Url.AbsoluteUri;
            if (HttpContext.Current.Request.Url.Query.Length > 0)
                orginalUrl = orginalUrl.Replace(HttpContext.Current.Request.Url.Query, string.Empty);
            return orginalUrl.Replace(HttpContext.Current.Request.Url.AbsolutePath, string.Empty) + ((HttpContext.Current.Request.ApplicationPath == "/" ? "" : HttpContext.Current.Request.ApplicationPath)) + '/';
        }
    }
}
